package com.example.sicnuaccountingapp.ui.budget

import com.example.sicnuaccountingapp.data.entity.Budget
import com.example.sicnuaccountingapp.data.entity.Category

sealed class BudgetUiState {
    object Loading : BudgetUiState()
    data class Success(
        val monthlyBudget: MonthlyBudgetInfo,
        val categoryBudgets: List<CategoryBudgetInfo>
    ) : BudgetUiState()
    data class Error(val message: String) : BudgetUiState()
}

data class MonthlyBudgetInfo(
    val totalBudget: Double,
    val totalExpense: Double,
    val progress: Float // 0-100
) {
    val remaining: Double get() = totalBudget - totalExpense
}

data class CategoryBudgetInfo(
    val budget: Budget,
    val category: Category,
    val expense: Double,
    val progress: Float // 0-100
) {
    val remaining: Double get() = budget.amount - expense
} 